package com.tbit.uqbike.object.pojo.vo;

import com.tbit.uqbike.annos.Excel;
import com.tbit.uqbike.constant.CsvConstant;
import com.tbit.uqbike.webmanager.util.csv.annotations.Csv;
import lombok.Data;

import java.util.Date;

/**
 * 骑行订单金额分布返回实体类
 *
 * @Author:BUGTian
 * @DATE: 2023/1/7
 */
@Data
public class RideUseLogVO {
    public Integer totalMoney;
    /**
     * 余额支付金额
     */
    public Integer balance;
    /**
     * 余额退款金额
     */
    public Integer balanceRefund;
    /**
     * 其他金额
     */
    public Integer other;
    /**
     * 其他退款金额
     */
    public Integer otherRefund;
    /**
     * 骑行订单号
     */
    @Excel(name = "骑行订单号", sort = 1)
    @Csv(name = "骑行订单号", type = CsvConstant.CSV_TYPE_WITHOUT)
    private String orderNO;
    /**
     * 充值类型
     */
    @Excel(name = "充值类型", readConverterExp = "1=微信app,2=微信小程序,3=支付宝app,4=微信支付分,5=支付宝小程序,7=汇付微信支付,8=汇付支付宝支付", sort = 7)
    @Csv(name = "充值类型", keys = {"1", "2", "3", "4", "5", "7", "8"}, values = {"微信app", "微信小程序", "支付宝app", "微信支付分", "支付宝小程序", "汇付微信支付", "汇付支付宝支付"}, type = CsvConstant.CSV_TYPE_WITHOUT)
    private Integer type;
    /**
     * 总金额 (单位：元)
     */
    @Csv(name = "总金额", type = CsvConstant.CSV_TYPE_WITHOUT)
    @Excel(name = "总金额", sort = 2)
    private Double totalMoneyYuan;
    /**
     * 余额支付金额 (单位：元)
     */
    @Csv(name = "余额支付金额", type = CsvConstant.CSV_TYPE_WITHOUT)
    @Excel(name = "余额支付金额", sort = 3)
    private Double balanceYuan;
    /**
     * 余额退款金额 (单位：元)
     */
    @Csv(name = "余额退款金额", type = CsvConstant.CSV_TYPE_WITHOUT)
    @Excel(name = "余额退款金额", sort = 4)
    private Double balanceRefundYuan;
    /**
     * 其他金额 (单位：元)
     */
    @Csv(name = "其他金额", type = CsvConstant.CSV_TYPE_WITHOUT)
    @Excel(name = "其他金额", sort = 5)
    private Double otherYuan;
    /**
     * 其他退款金额 (单位：元)
     */
    @Csv(name = "其他退款金额", type = CsvConstant.CSV_TYPE_WITHOUT)
    @Excel(name = "其他退款金额", sort = 6)
    private Double otherRefundYuan;
    /**
     * 添加时间
     */
    @Excel(name = "添加时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 8)
    @Csv(name = "添加时间", type = CsvConstant.CSV_TYPE_WITHOUT)
    private Date addTime;

    public Double getTotalMoneyYuan() {
        return totalMoney == null ? 0D : (double) totalMoney / 100D;
    }

    public Double getBalanceYuan() {
        return balance == null ? 0D : (double) balance / 100D;
    }

    public Double getBalanceRefundYuan() {
        return balanceRefund == null ? 0D : (double) balanceRefund / 100D;
    }

    public Double getOtherYuan() {
        return other == null ? 0D : (double) other / 100D;
    }

    public Double getOtherRefundYuan() {
        return otherRefund == null ? 0D : (double) otherRefund / 100D;
    }
}
